package com.chenhao.springcloud.chenhaodesignservice.pattern.structural.composite;

/**
 * Description:
 *
 * @author chenhao
 * @date 2020/12/28 10:29
 */
public class Test {
    public static void main(String[] args) {
        CatalogComponent linuxCpurse = new Course("Linux课程",11);
        CatalogComponent windowsCourse = new Course("windows课程",2);
        CatalogComponent javaCourseCatalog = new CourseCatalog("Java课程");
        CatalogComponent mmallCourse1 = new Course("Java电商一期",55);
        CatalogComponent mmallCourse2 = new Course("windows课程",66);
        CatalogComponent mmallCourse3 = new Course("windows课程",77);
        CatalogComponent imoocMainCourseCatalog = new CourseCatalog("课程目录");
        imoocMainCourseCatalog.add(mmallCourse1);
        imoocMainCourseCatalog.add(mmallCourse2);
        imoocMainCourseCatalog.add(mmallCourse3);
        imoocMainCourseCatalog.print();
    }
}
